Using Aspect-oriented Programming to Instrument Ocl Contracts in Java

نویسندگان

  • L. C. Briand
  • W. Dzidek
  • Y. Labiche
چکیده

Analysis and design by contract allows the definitions of a formal agreement between a class and its clients, expressing each party’s rights and obligations. Contracts written in the Object-Constraint Language (OCL) are known to be a useful technique to specify the precondition and postcondition of operations and class invariants in a UML context, making the definition of object-oriented analysis or design elements more precise. In this report, we introduce the ocl2j approach to automatically instrument OCL constraints in Java programs using aspect-oriented programming (AOP). One of the many possible applications of checking contract assertions at run time is to help testing and debugging. The approach strives for automatic, efficient generation of contract code and a nonintrusive instrumentation technique. It is assessed on a case study and initial results show that the approach is viable. We conclude by discussing strategies to optimize instrumentation so as to further decrease overhead.

برای دانلود رایگان متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

An Aspect-Oriented Infrastructure for Design by Contract in Java

Design by Contract was first introduced in the Eiffel programming language to address the reliability concern in Object-Oriented Software Development, namely on module interaction. On the other hand, Aspect-Oriented Software Development aims at providing a means to identify, modularise and compose cross-cutting concerns, which classical approaches for software development can not modularise. Th...

متن کامل

Automatic Detection to the Behavioral Conflict in AOP Application Based on Design by Contract

Behavioral conflict is one of the key issues in the practical application of AOP (Aspect-Oriented Programming) technology. Based on the ideas of design by contract and behavioral subtyping, we propose an approach that detects the behavioral conflict automatically at runtime. Use Java annotation to describe the contracts of the base program and aspect code, then extract these contracts through t...

متن کامل

A Study on Exception Detection and Handling Using Aspect-Oriented Programming

Aspect-Oriented Programming (AOP) is intended to ease situations that involve many kinds of code tangling. This paper reports on a study to investigate AOP’s ability to ease tangling related to exception detection and handling. We took an existing framework written in Java , the JWAM framework, and partially reengineered its exception detection and handling aspects using AspectJ , an aspector...

متن کامل

Investigating the use of analysis contracts to improve the testability of object-oriented code

A number of activities involved in testing software are known to be difficult and time consuming. Among them is the definition and coding of test oracles and the isolation of faults once failures have been detected. Through a thorough and rigorous empirical study, we investigate how the instrumentation of contracts could address both issues. Contracts are known to be a useful technique to speci...

متن کامل

Towards Verifying Java Realizations of Ocl-constrained Design Models Using Jml

The Object Constraint Language OCL is a formal textual notation that could be used for placing constraints on the modelling elements that occur in UML diagrams. Constraints include invariants on classes and types, and preconditions and postconditions of operations. OCL was designed to be used in conjunctions with UML diagrams resulting in more precise object-oriented designs. The Java Modelling...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

عنوان ژورنال:

دوره   شماره 

صفحات  -

تاریخ انتشار 2004